package com.example.springdemo.mvc;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhangding
 * @date
 */
@RestController
@Slf4j
public class SingletonMvc {


    public  String single = "777";
    @GetMapping("/single")
    public String sing(){
        single = "888";
        return single;
    }

    @GetMapping("/single2")
    public String sing2(){

        return single;

    }

    @PostMapping(value = "/post")
    public String postTest(@RequestBody User user){
        log.info(user.getUserAge());
        return "666";
    }




}
